import { View } from '@tarojs/components';
import React, {useState, useImperativeHandle,forwardRef} from 'react';
// props子组件中需要接受ref
let ChildComp = (props, ref) => {
    // 此处注意useImperativeHandle方法的的第一个参数是目标元素的ref引用
    useImperativeHandle(ref, () => ({
        // changeVal 就是暴露给父组件的方法
        changeVal: (newVal) => {
           console.log('333333333')
        }
    }));
    return (
        <View>3333333</View>
    )
}
export default forwardRef(ChildComp)